package Test1;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        UseCompute useCompute=new UseCompute();
        ICalculator i=null;
        Scanner sca=new Scanner(System.in);
        System.out.println("请输入第一个数字:");
        int one=sca.nextInt();
        System.out.println("请输入第二个数字:");
        int two=sca.nextInt();
        System.out.println("请输入计算方法(+ - * /):");
        String str=sca.next();
        switch (str){
            case "+":{
                i=new Add();
                break;
            } case "-":{
                i=new Subtract();
                break;
            } case "*":{
                i=new Multiply();
                break;
            } case "/":{
                i=new Divide();
                break;
            }
        }
        useCompute.useCom(i,one,two);
    }
}
